Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing /
Chapter 3 - Page Formatting and Dialog Box Customization / Using Format Objects and Collection Items to Format Pages


Obtaining the Mapping From a Format Object

To access a format object's mapping, your application uses the GXGetFormatMapping function. Listing 3-15 shows how to obtain the mapping for the format object associated with the whichPage page.

Listing 3-15 Obtaining a format object's mapping

OSErr MyGetFormatMapping(MyDocumentPtr myDocument, long whichPage,
                           gxMapping *theMapping)
{
   gxFormat    pgFormat;

   /* 
      Get the current page's format. A nil reference specifies
      using the job's format object.
   */
   pgFormat = myDocument->pageFormat[whichPage -1];
   if (pgFormat == nil)
      pgFormat = GXGetJobFormat(myDocument->documentJob, 1);

   /* Get the format's mapping. */
   GXGetFormatMapping(pgFormat, theMapping);
   return GXGetJobError(myDocument->documentJob);
}
For an introduction to mapping, see "Mapping for Format Objects" beginning on page 3-18.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help